package d1_file;

import java.io.File;

public class t1 {
    public static void main(String[] args) {
//     File f1 = new File("D:\\wuyong\\ab.txt");
//        File f1 = new File("D:/wuyong/ab.txt");
        File f1 = new File("D:"+File.separator+"wuyong"+File.separator+"ab.txt");//separator分离器适配不同系统
     System.out.println(f1.length());

     File f2 = new File("D:"+File.separator+"wuyong");
        System.out.println(f2.length());

        File f3 = new File("D:/wuyong/ab111.txt");
        System.out.println(f3.length());
        System.out.println(f3.exists());

        //相对路径
        File f4 = new File("D:\\mycode\\file10\\src\\111");//绝对路径
        System.out.println(f4.length());
        File f5 = new File("src\\d1_file\\t1.java");
        System.out.println(f5.length());//相对路径
    }
}
